/* 练习页面专用样式 */

/* 侧边栏关闭按钮样式 */
.close-btn {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f6fc;
}

/* 侧边栏导航样式 */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(48, 54, 61, 0.5);
    transition: right 0.3s ease;
    z-index: 1000;
}

.sidebar.active {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar.active ~ .sidebar-overlay {
    display: block;
}

.sidebar-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.sidebar-header h3 {
    color: #f0f6fc;
    margin: 0;
    font-size: 18px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #8b949e;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(48, 54, 61, 0.5);
    color: #f0f6fc;
}

.nav-item.active {
    background: rgba(33, 136, 255, 0.1);
    color: #58a6ff;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.nav-item span {
    font-size: 14px;
}

body.sidebar-open {
    overflow: hidden;
}

/* 练习内容区域 */
.practice-content {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(195, 94, 94, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    padding: 20px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 练习头部 */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.practice-info h2 {
    color: #e6edf3;
    margin-bottom: 10px;
    font-size: 24px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-question {
    color: #8b949e;
    font-size: 14px;
    min-width: 80px;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255,0);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f6feb, #58a6ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.exit-practice {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f85149;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exit-practice:hover {
    background: rgba(248, 81, 73, 0.2);
    border-color: #f85149;
}

/* 题目区域 */
.question-area {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
}

.question-content h3 {
    color: #e6edf3;
    margin-bottom: 15px;
    font-size: 18px;
}

.question-text {
    color: #c9d1d9;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 填空输入框 */
.fill-blank {
    background: rgba(255, 255, 255, 0);
    color: #e6edf3;
    padding: 6px 12px;
    font-size: 14px;
    min-width: 120px;
    margin: 0 4px;
    transition: all 0.2s;
    border: none; /* 清除默认四周边框 */
    border-bottom: 1px solid #ccc; /* 底部灰色下划线（可修改颜色/粗细） */
}

.fill-blank:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0);
    border: none; /* 清除默认四周边框 */
    border-bottom: 1px solid #3579b0; /* 底部灰色下划线（可修改颜色/粗细） */
}

.fill-blank.correct {
    border-color: #238636;
    background: rgba(35, 134, 54, 0.1);
}

.fill-blank.incorrect {
    border-color: #f85149;
    background: rgba(248, 81, 73, 0.1);
}

.fill-blank::placeholder {
    color: #8b949e;
}

/* 题目操作按钮 */
.question-actions {
    display: flex;
    gap: 12px;
}

.check-answer, .next-question {
    background: rgba(31, 111, 235, 0.1);
    border: 1px solid rgba(31, 111, 235, 0.3);
    color: #58a6ff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.check-answer:hover, .next-question:hover:not(:disabled) {
    background: rgba(31, 111, 235, 0.2);
    border-color: #1f6feb;
}

.next-question:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 掌握程度选择 */
.mastery-level {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
}

.mastery-level h4 {
    color: #e6edf3;
    margin-bottom: 15px;
    font-size: 16px;
}

.mastery-buttons {
    display: flex;
    gap: 12px;
}

.mastery-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    border: 1px solid transparent;
}

.mastery-btn.mastered {
    background: rgba(35, 134, 54, 0.1);
    color: #3fb950;
    border-color: rgba(35, 134, 54, 0.3);
}

.mastery-btn.uncertain {
    background: rgba(187, 128, 9, 0.1);
    color: #d29922;
    border-color: rgba(187, 128, 9, 0.3);
}

.mastery-btn.not-mastered {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.3);
}

.mastery-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mastery-btn.selected {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 右侧栏样式 */
.right-sidebar {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    padding: 20px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 侧边栏区域 */
.sidebar-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.section-header h3 {
    color: #e6edf3;
    font-size: 16px;
    margin: 0;
}

.toggle-icon {
    color: #8b949e;
    transition: transform 0.2s;
}

.section-content {
    padding: 20px;
    background: rgba(255, 255, 255, 0.01);
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

/* 答案内容 */
.answer-content h4 {
    color: #e6edf3;
    margin-bottom: 15px;
    font-size: 14px;
}

.answer-list {
    margin-bottom: 20px;
}

.answer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.answer-item:last-child {
    border-bottom: none;
}

.blank-number {
    color: #8b949e;
    font-size: 12px;
    min-width: 50px;
}

.answer-text {
    color: #3fb950;
    font-weight: 500;
    background: rgba(35, 134, 54, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.explanation {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 15px;
}

.explanation h5 {
    color: #e6edf3;
    margin-bottom: 8px;
    font-size: 13px;
}

.explanation p {
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.5;
}

/* 笔记内容 */
.notes-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 12px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-header h4 {
    color: #e6edf3;
    font-size: 13px;
    margin: 0;
}

.note-time {
    color: #8b949e;
    font-size: 11px;
}

.note-text {
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.add-note-btn {
    background: rgba(31, 111, 235, 0.1);
    border: 1px solid rgba(31, 111, 235, 0.3);
    color: #58a6ff;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
}

.add-note-btn:hover {
    background: rgba(31, 111, 235, 0.2);
    border-color: #1f6feb;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: rgba(35, 134, 54, 0.9);
    border: 1px solid #238636;
}

.message.warning {
    background: rgba(187, 128, 9, 0.9);
    border: 1px solid #bb8009;
}

.message.info {
    background: rgba(31, 111, 235, 0.9);
    border: 1px solid #1f6feb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 活跃的题目项 */
.topic-item.active {
    background: rgba(31, 111, 235, 0.1);
    border-left: 3px solid #1f6feb;
    color: #58a6ff;
}

/* 滚动条样式 */
.section-content::-webkit-scrollbar {
    width: 6px;
}

.section-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr 2fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .practice-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .mastery-buttons {
        flex-direction: column;
    }
    
    .question-actions {
        flex-direction: column;
    }
}